<?php /* Smarty version 2.6.16, created on 2012-03-14 12:01:06
         compiled from registration-tutor.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'registration-tutor.tpl', 185, false),array('modifier', 'count', 'registration-tutor.tpl', 225, false),array('modifier', 'inarray', 'registration-tutor.tpl', 228, false),)), $this); ?>
<?php echo '
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jQuery.functions.pack.js"></script>
<link rel="stylesheet" href="style/autosuggest.css" type="text/css" />
<script type="text/javascript" src="js/jquery.ausu-autosuggest.min.js"></script>
<script language="javascript" type="text/javascript">
var $ = jQuery.noConflict();
$(document).ready(function(){
	getPageId(\'';  echo $this->_tpl_vars['Formval']['game_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['ladder_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['race_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['server_id'];  echo '\');

    $.fn.autosugguest({  
           className: \'ausu-suggest\',
          methodType: \'POST\',
            minChars: 2,
              rtnIDs: true,
            dataFile: \'autocomplete.php?action=populateCity\'
    });

});

function getPageId(type,id,rid,sid)
{	

	$.ajax({
			type:\'POST\',
			url:\'get_game_info.php\',
			data: \'type=\'+type+\'&id=\'+id+\'&rid=\'+rid+\'&sid=\'+sid,
			dataType:\'json\',
			success:function(jData){
			
				if(jData.flag == 1)
				{
					$(\'#ladder_id_td\').html(jData.html);
					$(\'#race_id_td\').html(jData.html1);
					$(\'#server_id_td\').html(jData.html2);
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				$(".contactus-block").html("Some server error occoured. Please report to system administrator.</div>");
			}
		});
}
function CheckFields()
{
 
    if(document.getElementById(\'user_type\').value==1)	
	{ 
	   if(!$("#paypal_email_id").emailCheck() || document.getElementById(\'paypal_email_id\').value==\'\' ) 
		   {
				$(\'#FormErrorMsg\').show();
				$(\'#FormErrorMsg\').html("Please Enter a Valid paypal email");
				$("#paypal_email_id").attr(\'style\',\'border:1px solid #FF0000\');
				return false;
		   }
      }
      if(document.getElementById(\'avail_L\').checked == true)
     {
		  if(document.getElementById(\'availability_city\').value==\'\')
		  {
			$(\'#FormErrorMsg\').show();
			$(\'#FormErrorMag\').html("Please enter availability city");
			$(\'#availability_city\').attr(\'style\',\'border:1px solid #FF0000\');
			return false; 
		  }	
		   if(document.getElementById(\'availability_country\').value==\'\')
		  {
				$(\'#FormErrorMsg\').show();
				$(\'#FormErrorMag\').html("Please select availability country");
				$(\'#availability_country\').attr(\'style\',\'border:1px solid #FF0000\');
				return false; 
		  }	
      }	  
	  if(document.getElementById(\'game_id\').value==\'\' ) 
	  {
		$(\'#FormErrorMsg\').show();
		$(\'#FormErrorMsg\').html("Please select a game");
		//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
		return false;
	 }
  return true;
 }  

 function showhide_div()
{
	
	if(document.getElementById(\'avail_L\').checked == true)
	{  
	   $(\'#avail_city\').show();
	  $(\'#avail_country\').show();	
	  $(\'#availability_city\').show();
	  $(\'#availability_country\').show();
	}
	if(document.getElementById(\'avail_L\').checked == false)
	{  		
	  $(\'#avail_city\').hide();
	  $(\'#avail_country\').hide();
	  $(\'#availability_city\').hide();
	  $(\'#availability_country\').hide();
	}  			
} 

function getChangeGame(id)
{
	$.post(\'game_details.php\',{\'game_id\':id, \'action\':\'get_content\'}, function(data){
		$(\'#dynamic_controls\').html(data);
	});
}
  function keyCheck(eventObj, obj)
{
    var keyCode
 
    // Check For Browser Type
    if (document.all){
        keyCode=eventObj.keyCode
    }
    else{
        keyCode=eventObj.which
    }
 
    var str=obj.value
 
    if(keyCode==46){
        if (str.indexOf(".")>0){
            return false
        }
    }
 
    if((keyCode<46 || keyCode >57)   &&   (keyCode >31)){ // Allow only integers and decimal points
        return false
    }
    
    return true
}
function CreateCountry()
{
    var cityid = $(\'#cityid\').val();
	
	if(cityid !=\'\')
	{
	   $.ajax({
	   type: "POST",
	   url: \'autocomplete.php?action=populateCountry&cityid=\'+cityid ,
	   dataType : \'html\',
	   success:function(response)
	   {
	     $(\'#coun\').html(response);
	   }
	  }) 	 
	}

}

</script>
'; ?>


 <div class="right-panel">
      <div class="findstudent-title"><h1 title="Profile"><span>Registration</span></h1>
        <div class="breadcrumb">Add Game</div>
        <div class="clear"></div>
	  </div>
      <div class="register">
	   <div id='FormErrorMsg' style="color:red; text-align:center; padding-bottom:10px;"><?php if ($this->_tpl_vars['ermsg'] != ''): ?> <?php echo $this->_tpl_vars['ermsg'];  endif; ?> </div>
      <form name="register" id="register" action="" method="post">
	  <input type="text" name="user_type" id="user_type" value="<?php echo $this->_tpl_vars['user_type']; ?>
" />
         <fieldset>
		    <?php if ($this->_tpl_vars['user_type'] == '1'): ?>
			<label>Paypal Email ID:</label>
            <input name="paypal_email_id" id="paypal_email_id" type="text" value="<?php echo $this->_tpl_vars['Formval']['paypal_email_id']; ?>
" class="con-req"/>
			<?php endif; ?>
			<label>Availability :</label>
			 <input type="checkbox" name="availability_type1" class='check' value="O" /><label class='chklabel'>Online</label>
			 <input type="checkbox" name="availability_type2" class='check' id="avail_L" onclick="showhide_div()" value="L" /><label class='chklabel'>Local</label>
            <p class="clear"></p>
			<label id="avail_city" <?php if ($this->_tpl_vars['Formval']['availability_type'] == 'L'): ?> <?php else: ?> style='display:none' <?php endif; ?>>City (Local meet-up) :</label>
           <div class="ausu-suggest">
		    <input name="availability_city" id="availability_city" type="text" value="<?php echo $this->_tpl_vars['Formval']['availability_city']; ?>
" class="con-req" autocomplete="off" 
			<?php if ($this->_tpl_vars['Formval']['availability_type'] == 'L'): ?> <?php else: ?> style='display:none' <?php endif; ?> onblur="CreateCountry()"/>
			<input name="cityid" id="cityid" type="hidden"  value="" autocomplete="off" />
			</div>
			
			<label id="avail_country" <?php if ($this->_tpl_vars['Formval']['availability_type'] == 'L'): ?> <?php else: ?> style='display:none' <?php endif; ?>>Count (Local meet-up) :</label>
			<div id="coun">
             <select name="availability_country" id="availability_country" class="selectbox con-req" <?php if ($this->_tpl_vars['Formval']['availability_type'] == 'L'): ?> <?php else: ?> style='display:none' <?php endif; ?>>
			  <option value="">Select</option>
			   <?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['CountryArr'],'selected' => $this->_tpl_vars['Formval']['country']), $this);?>

			 </select>
			 </div>
			 <div class="clear"></div>
			 <div class="clear"></div>
            <p class="clear"></p>
            <label>Select Game :</label>
            <select name="game_id" id="game_id" class="selectbox" onchange="getChangeGame(this.value)">
				<option value="">Select</option>
				<?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['GameArr'],'selected' => $this->_tpl_vars['Formval']['game_id']), $this);?>

			</select>
			<?php if ($this->_tpl_vars['user_type'] == '1'): ?>
            <label>Rate ($):</label>
            <input name="rate" id="rate" type="text" value="<?php echo $this->_tpl_vars['Formval']['rate']; ?>
" onkeypress="return keyCheck(event, this);"/>
			<?php endif; ?>
			<?php if ($this->_tpl_vars['user_type'] == '2'): ?>
		    <label>Peak Hours:</label>
            <input name="rate" id="rate" type="text" value="<?php echo $this->_tpl_vars['Formval']['peak_hours']; ?>
" onkeypress="return keyCheck(event, this);"/>
			<?php endif; ?>
			<p class="clear"></p>
		   
		   <p id="dynamic_controls">
			<!--THE DYNAMIC CONTROL WILL PRINT HERE - PROSENJIT-->
			<?php echo $this->_tpl_vars['extra_content']; ?>

		   </p>
		   <!--span id="ladder">
            <p class="clear"></p>
            <label>Select Ladder :</label>
			<span >
            <select name="ladder_id" id="ladder_id">
					<option value="">Select</option>
					<?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['LadderArr'],'selected' => $this->_tpl_vars['FabricArr']['ladder_id']), $this);?>

			</select>
			</span>
			 <p class="clear"></p>
			 </span>
			 
			 <span  id="race">
			 <label>Select Race :</label> <p class="clear"></p>
			<span>
           <?php if (count($this->_tpl_vars['RaceArr']) != 0): ?>
		 	<?php unset($this->_sections['RowRace']);
$this->_sections['RowRace']['name'] = 'RowRace';
$this->_sections['RowRace']['loop'] = is_array($_loop=$this->_tpl_vars['RaceArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['RowRace']['show'] = true;
$this->_sections['RowRace']['max'] = $this->_sections['RowRace']['loop'];
$this->_sections['RowRace']['step'] = 1;
$this->_sections['RowRace']['start'] = $this->_sections['RowRace']['step'] > 0 ? 0 : $this->_sections['RowRace']['loop']-1;
if ($this->_sections['RowRace']['show']) {
    $this->_sections['RowRace']['total'] = $this->_sections['RowRace']['loop'];
    if ($this->_sections['RowRace']['total'] == 0)
        $this->_sections['RowRace']['show'] = false;
} else
    $this->_sections['RowRace']['total'] = 0;
if ($this->_sections['RowRace']['show']):

            for ($this->_sections['RowRace']['index'] = $this->_sections['RowRace']['start'], $this->_sections['RowRace']['iteration'] = 1;
                 $this->_sections['RowRace']['iteration'] <= $this->_sections['RowRace']['total'];
                 $this->_sections['RowRace']['index'] += $this->_sections['RowRace']['step'], $this->_sections['RowRace']['iteration']++):
$this->_sections['RowRace']['rownum'] = $this->_sections['RowRace']['iteration'];
$this->_sections['RowRace']['index_prev'] = $this->_sections['RowRace']['index'] - $this->_sections['RowRace']['step'];
$this->_sections['RowRace']['index_next'] = $this->_sections['RowRace']['index'] + $this->_sections['RowRace']['step'];
$this->_sections['RowRace']['first']      = ($this->_sections['RowRace']['iteration'] == 1);
$this->_sections['RowRace']['last']       = ($this->_sections['RowRace']['iteration'] == $this->_sections['RowRace']['total']);
?>
			<input type="checkbox" name="submited_race[]"  value="<?php echo $this->_tpl_vars['RaceArr'][$this->_sections['RowRace']['index']]['race_id']; ?>
" 
<?php if (((is_array($_tmp=$this->_tpl_vars['RaceArr'][$this->_sections['RowRace']['index']]['race_id'])) ? $this->_run_mod_handler('inarray', true, $_tmp, $this->_tpl_vars['submited_race']) : in_array($_tmp, $this->_tpl_vars['submited_race']))): ?>checked<?php endif; ?> /> 
			<?php echo $this->_tpl_vars['RaceArr'][$this->_sections['RowRace']['index']]['race_title']; ?>
		
			 <p class="clear"></p>
			<?php endfor; endif; ?>
			<?php endif; ?>
			</span>
			</span>
			
			<span  id="rating">
			 <label>Select Rating :</label> <p class="clear"></p>
			<span id="rating">
       <?php if (count($this->_tpl_vars['RatingArr']) != 0): ?>
		 	<?php unset($this->_sections['RowRating']);
$this->_sections['RowRating']['name'] = 'RowRating';
$this->_sections['RowRating']['loop'] = is_array($_loop=$this->_tpl_vars['RatingArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['RowRating']['show'] = true;
$this->_sections['RowRating']['max'] = $this->_sections['RowRating']['loop'];
$this->_sections['RowRating']['step'] = 1;
$this->_sections['RowRating']['start'] = $this->_sections['RowRating']['step'] > 0 ? 0 : $this->_sections['RowRating']['loop']-1;
if ($this->_sections['RowRating']['show']) {
    $this->_sections['RowRating']['total'] = $this->_sections['RowRating']['loop'];
    if ($this->_sections['RowRating']['total'] == 0)
        $this->_sections['RowRating']['show'] = false;
} else
    $this->_sections['RowRating']['total'] = 0;
if ($this->_sections['RowRating']['show']):

            for ($this->_sections['RowRating']['index'] = $this->_sections['RowRating']['start'], $this->_sections['RowRating']['iteration'] = 1;
                 $this->_sections['RowRating']['iteration'] <= $this->_sections['RowRating']['total'];
                 $this->_sections['RowRating']['index'] += $this->_sections['RowRating']['step'], $this->_sections['RowRating']['iteration']++):
$this->_sections['RowRating']['rownum'] = $this->_sections['RowRating']['iteration'];
$this->_sections['RowRating']['index_prev'] = $this->_sections['RowRating']['index'] - $this->_sections['RowRating']['step'];
$this->_sections['RowRating']['index_next'] = $this->_sections['RowRating']['index'] + $this->_sections['RowRating']['step'];
$this->_sections['RowRating']['first']      = ($this->_sections['RowRating']['iteration'] == 1);
$this->_sections['RowRating']['last']       = ($this->_sections['RowRating']['iteration'] == $this->_sections['RowRating']['total']);
?>
			<input type="checkbox" name="submited_rating[]"  value="<?php echo $this->_tpl_vars['RatingArr'][$this->_sections['RowRating']['index']]['rating_id']; ?>
" 
<?php if (((is_array($_tmp=$this->_tpl_vars['RatingArr'][$this->_sections['RowRating']['index']]['rating_id'])) ? $this->_run_mod_handler('inarray', true, $_tmp, $this->_tpl_vars['submited_rating']) : in_array($_tmp, $this->_tpl_vars['submited_rating']))): ?>checked<?php endif; ?> /> 
			<?php echo $this->_tpl_vars['RatingArr'][$this->_sections['RowRating']['index']]['rating_title']; ?>
		
			 <p class="clear"></p>
			<?php endfor; endif; ?>
			<?php endif; ?>
			</span>
			</span>
			
			<span id="region">
			 <label>Select Region :</label> <p class="clear"></p>
			<span id="region">
          <?php if (count($this->_tpl_vars['RegionArr']) != 0): ?>
		 	<?php unset($this->_sections['RowRegion']);
$this->_sections['RowRegion']['name'] = 'RowRegion';
$this->_sections['RowRegion']['loop'] = is_array($_loop=$this->_tpl_vars['RegionArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['RowRegion']['show'] = true;
$this->_sections['RowRegion']['max'] = $this->_sections['RowRegion']['loop'];
$this->_sections['RowRegion']['step'] = 1;
$this->_sections['RowRegion']['start'] = $this->_sections['RowRegion']['step'] > 0 ? 0 : $this->_sections['RowRegion']['loop']-1;
if ($this->_sections['RowRegion']['show']) {
    $this->_sections['RowRegion']['total'] = $this->_sections['RowRegion']['loop'];
    if ($this->_sections['RowRegion']['total'] == 0)
        $this->_sections['RowRegion']['show'] = false;
} else
    $this->_sections['RowRegion']['total'] = 0;
if ($this->_sections['RowRegion']['show']):

            for ($this->_sections['RowRegion']['index'] = $this->_sections['RowRegion']['start'], $this->_sections['RowRegion']['iteration'] = 1;
                 $this->_sections['RowRegion']['iteration'] <= $this->_sections['RowRegion']['total'];
                 $this->_sections['RowRegion']['index'] += $this->_sections['RowRegion']['step'], $this->_sections['RowRegion']['iteration']++):
$this->_sections['RowRegion']['rownum'] = $this->_sections['RowRegion']['iteration'];
$this->_sections['RowRegion']['index_prev'] = $this->_sections['RowRegion']['index'] - $this->_sections['RowRegion']['step'];
$this->_sections['RowRegion']['index_next'] = $this->_sections['RowRegion']['index'] + $this->_sections['RowRegion']['step'];
$this->_sections['RowRegion']['first']      = ($this->_sections['RowRegion']['iteration'] == 1);
$this->_sections['RowRegion']['last']       = ($this->_sections['RowRegion']['iteration'] == $this->_sections['RowRegion']['total']);
?>
			<input type="checkbox" name="submited_region[]"  value="<?php echo $this->_tpl_vars['RegionArr'][$this->_sections['RowRegion']['index']]['region_id']; ?>
" 
<?php if (((is_array($_tmp=$this->_tpl_vars['RegionArr'][$this->_sections['RowRegion']['index']]['region_id'])) ? $this->_run_mod_handler('inarray', true, $_tmp, $this->_tpl_vars['submited_region']) : in_array($_tmp, $this->_tpl_vars['submited_region']))): ?>checked<?php endif; ?> /> 
			<?php echo $this->_tpl_vars['RegionArr'][$this->_sections['RowRegion']['index']]['region_title']; ?>
		
			 <p class="clear"></p>
			<?php endfor; endif; ?>
			<?php endif; ?>
			</span>
			</span>
			
			<span id="server">
			 <label>Select Server :</label> <p class="clear"></p>
			<span >
            <?php if (count($this->_tpl_vars['ServerArr']) != 0): ?>
		 	<?php unset($this->_sections['RowServer']);
$this->_sections['RowServer']['name'] = 'RowServer';
$this->_sections['RowServer']['loop'] = is_array($_loop=$this->_tpl_vars['ServerArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['RowServer']['show'] = true;
$this->_sections['RowServer']['max'] = $this->_sections['RowServer']['loop'];
$this->_sections['RowServer']['step'] = 1;
$this->_sections['RowServer']['start'] = $this->_sections['RowServer']['step'] > 0 ? 0 : $this->_sections['RowServer']['loop']-1;
if ($this->_sections['RowServer']['show']) {
    $this->_sections['RowServer']['total'] = $this->_sections['RowServer']['loop'];
    if ($this->_sections['RowServer']['total'] == 0)
        $this->_sections['RowServer']['show'] = false;
} else
    $this->_sections['RowServer']['total'] = 0;
if ($this->_sections['RowServer']['show']):

            for ($this->_sections['RowServer']['index'] = $this->_sections['RowServer']['start'], $this->_sections['RowServer']['iteration'] = 1;
                 $this->_sections['RowServer']['iteration'] <= $this->_sections['RowServer']['total'];
                 $this->_sections['RowServer']['index'] += $this->_sections['RowServer']['step'], $this->_sections['RowServer']['iteration']++):
$this->_sections['RowServer']['rownum'] = $this->_sections['RowServer']['iteration'];
$this->_sections['RowServer']['index_prev'] = $this->_sections['RowServer']['index'] - $this->_sections['RowServer']['step'];
$this->_sections['RowServer']['index_next'] = $this->_sections['RowServer']['index'] + $this->_sections['RowServer']['step'];
$this->_sections['RowServer']['first']      = ($this->_sections['RowServer']['iteration'] == 1);
$this->_sections['RowServer']['last']       = ($this->_sections['RowServer']['iteration'] == $this->_sections['RowServer']['total']);
?>
			<input type="checkbox" name="submited_server[]"  value="<?php echo $this->_tpl_vars['ServerArr'][$this->_sections['RowServer']['index']]['server_id']; ?>
" 
<?php if (((is_array($_tmp=$this->_tpl_vars['ServerArr'][$this->_sections['RowServer']['index']]['server_id'])) ? $this->_run_mod_handler('inarray', true, $_tmp, $this->_tpl_vars['submited_server']) : in_array($_tmp, $this->_tpl_vars['submited_server']))): ?>checked<?php endif; ?> /> 
			<?php echo $this->_tpl_vars['ServerArr'][$this->_sections['RowServer']['index']]['server_name']; ?>
		
			 <p class="clear"></p>
			<?php endfor; endif; ?>
			<?php endif; ?>
			</span>
			</span-->
			
			<p class="clear"></p>
            <label>Experience :</label>
            <textarea  name="experience" id="experience"></textarea>
			<?php if ($this->_tpl_vars['user_type'] == '1'): ?>
            <p class="clear"></p>
			<label>Lesson Plan :</label>
            <textarea  name="lesson_plan" id="lesson_plan"></textarea>
			<?php endif; ?>
            <p class="clear"></p>
           
            <label>&nbsp;</label>
            <input name="submit" class="submit" value="Submit" type="submit" onclick='return CheckFields()' />
            <input name="" class="cancel" value="Cancel" type="reset" />
         </fieldset>
      </form>
      </div>
      
      
      
      <div class="clear"></div>
   </div>